<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <div th:insert="commen/head :: header">
    </div>
    <style>
        .body{
            background: #f2f5f7;
        }
        #section1 {background-color: #1E88E5;}
    </style>
</head>
<body  style="background-color: rgb(242,244,247)">
    <div th:insert="commen/navigationBar :: topNavBar"></div>
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-2">
                <div style="text-align: center" th:insert="commen/navigationBar :: leafTeaNavBar"></div>
            </div>
            <div class="col-md-8">
                <div style="margin-top: 5px;">
                    <div style="background: white;top: 10%;border-radius: 10px; padding: 10px;">
                        <a href="#section1"><button type="button" class="btn btn-primary btn-lg">新建话题</button></a>
                        <h3>全部话题：共[[${topics.size()}]]个话题</h3>
                        <div th:each="topic : ${topics}" style="width: 90%;border-radius: 30px;background: white;height: 100px;margin-left: 5%">
                            <a th:href="@{'/intoTopic/' + ${topic.getTopicId()} }" style="text-decoration: none;color: black">
                                <!--            <img src="images/jiuye.png" style="height: 50px;width: 50px" class="img-circle">-->
                                <img th:src="@{'../img/' + ${topic.getUser().getUserImg()}}" style="width: 40px; height: 40px; border-radius: 20px">
                                <span th:text="${topic.getUser().getUserName()}">djksfik</span>
                                <span th:text="${topic.getTopicTime()}"></span>
                                <div style="width: 100%;margin-left: 10%"><p><b th:text="${topic.getTopicTitle()}" >NO:1</b></p></div>
                                <div style="width: 100%;margin-left: 10%"><p th:text="${topic.getTopicContent()}">NO:1</p></div>
                            </a>
                        </div>
                    </div>
                    <div id="section1" style="background: white;top: 10%;margin-top: 10px;border-radius: 10px; padding: 10px;">
                        <h3>新建话题</h3>
                        <form th:action="@{/addTopic}" method="post">
                            <input type="hidden" th:value="${courseId}" name="courseId">
                            <p><input name="topicTitle" type="text" class="form-control" placeholder="请输入标题"></p>
                            <p><textarea name="topicContent" class="form-control" rows="4" placeholder="请输入话题正文"></textarea></p>
                            <input class="btn btn-primary" type="submit" value="发布"><br>
                        </form>
                    </div>
                </div>
            </div>
            <div class="col-md-2">
                <div style="background: white; border-radius: 15px;margin-top: 5px;">
                    <div style="padding: 20px;">
                        <span style="font-size: 22px;font-weight: bold;">我的</span>
                        <a th:href="@{'/toMyTopic/' + ${session.user.getUserId()}}"><h4><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>&nbsp;我发布的</h4></a>
                        <a th:href="@{/toMyReply}"><h4><span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>&nbsp;我回复的</h4></a>
                        <a th:href="@{/toMyReplyed}"><h4><span class="glyphicon glyphicon-comment" aria-hidden="true"></span>&nbsp;回复我的</h4></a>
                    </div>
                </div>
            </div>
        </div>
    </div>


</body>
</html>